package com.ruoyi.peopleinfo.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.peopleinfo.mapper.PeopleHealthMapper;
import com.ruoyi.peopleinfo.domain.PeopleHealth;
import com.ruoyi.peopleinfo.service.IPeopleHealthService;

/**
 * 健康信息Service业务层处理
 *
 * @author y
 * @date 2022-02-26
 */
@Service
public class PeopleHealthServiceImpl implements IPeopleHealthService
{
    @Autowired
    private PeopleHealthMapper peopleHealthMapper;

    /**
     * 查询健康信息
     *
     * @param id 健康信息主键
     * @return 健康信息
     */
    @Override
    public PeopleHealth selectPeopleHealthById(Long id)
    {
        return peopleHealthMapper.selectPeopleHealthById(id);
    }

    /**
     * 查询健康信息列表
     *
     * @param peopleHealth 健康信息
     * @return 健康信息
     */
    @Override
    //用户权限注解
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<PeopleHealth> selectPeopleHealthList(PeopleHealth peopleHealth)
    {
        return peopleHealthMapper.selectPeopleHealthList(peopleHealth);
    }

    /**
     * 新增健康信息
     *
     * @param peopleHealth 健康信息
     * @return 结果
     */
    @Override
    public int insertPeopleHealth(PeopleHealth peopleHealth)
    {
        return peopleHealthMapper.insertPeopleHealth(peopleHealth);
    }

    /**
     * 修改健康信息
     *
     * @param peopleHealth 健康信息
     * @return 结果
     */
    @Override
    public int updatePeopleHealth(PeopleHealth peopleHealth)
    {
        return peopleHealthMapper.updatePeopleHealth(peopleHealth);
    }

    /**
     * 批量删除健康信息
     *
     * @param ids 需要删除的健康信息主键
     * @return 结果
     */
    @Override
    public int deletePeopleHealthByIds(Long[] ids)
    {
        return peopleHealthMapper.deletePeopleHealthByIds(ids);
    }

    /**
     * 删除健康信息信息
     *
     * @param id 健康信息主键
     * @return 结果
     */
    @Override
    public int deletePeopleHealthById(Long id)
    {
        return peopleHealthMapper.deletePeopleHealthById(id);
    }
}
